package com.dadibadi.core.member.controller;


import com.dadibadi.core.dao.entity.MemberApplyTab;
import com.dadibadi.core.member.qo.MemberApplyEditQO;
import com.dadibadi.core.member.service.MemberService;
import com.venusoft.developer.common.result.CommonResult;
import com.venusoft.developer.common.result.ICommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


/**
 * TODO
 *
 * @author : lkfs@163.com
 * @date : 2025-08-25 15:57
 */

@RestController
@RequestMapping("/api")
@Slf4j
@Tag(name = "api/会员管理", description = "")
public class ApiMemberApplySaveController {
    @Resource
    MemberService memberService;

    @PostMapping("/api-member-apply-save")
    @Operation(summary = "保存", description = "")
    public ICommonResult exec(
            @RequestBody @Parameter(required = true) @Validated MemberApplyEditQO qo,
            @RequestHeader(required = false) String platform,
            @RequestHeader(required = false) String version,
            HttpServletRequest request) {

        MemberApplyTab memberApplyTab= memberService.saveMemberApply(qo);
        return new CommonResult<>(memberApplyTab.getUserId());

    }
}
